import time

from selenium.webdriver.common.by import By

from Base.action import Bases


class Login(Bases):
    # 登录环境链接
    Url55 = "https://test.kritycat.com"
    Url81 = "https://uat.kritycat.com"
    # 登录账号与密码
    user = ""
    password = ""

    # 登录55环境
    def login55(self):
        # 打开环境链接
        self.open(self.Url55)
        # 登录操作引用
        self.LoginKeyBoard()
        time.sleep(5)

    # 登录81环境
    def login81(self):
        # 打开环境链接
        self.open(self.Url81)
        # 登录操作引用
        self.LoginKeyBoard()
        time.sleep(5)

    # 登录操作
    def LoginKeyBoard(self):
        # 账号
        self.input(By.ID, "user", self.user)
        # 密码
        self.input(By.ID, "password", self.password)
        # 点击登录
        self.click(By.ID, "login")
